//
//  PhotoSelectionView.h
//  XPhoto
//
//  Created by baboy on 2019/2/22.
//  Copyright © 2019 baboy. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Photos/Photos.h>

NS_ASSUME_NONNULL_BEGIN

@protocol PhotoSelectionViewDelegate;
@interface PhotoSelectionView : UIView<UICollectionViewDelegate, UICollectionViewDataSource>
@property(nonatomic, strong) UICollectionView *collectionView;
@property(nonatomic, assign) IBOutlet id<PhotoSelectionViewDelegate> delegate;
@property(nonatomic, assign) NSInteger maxSelectedCount;
@property(nonatomic, assign) NSInteger maxVideoCount;
@property(nonatomic, assign) NSInteger maxPhotoCount;
@property(nonatomic, assign) BOOL forceShowCheckBox;
/**
 * 是否只能选择一个类型，默认true
 */
@property(nonatomic, assign) BOOL selectionOneType;

- ( NSArray<PHAsset*>*) selectedAssets;
@end

@protocol PhotoSelectionViewDelegate <NSObject>

@optional
- (void)photoSelectionView:(id)view didSelectPhotos:(NSArray*)photos;
- (void)photoSelectionView:(id)view didSelectPhoto:(id)photo;
- (void)photoSelectionView:(id)view didDeselectPhoto:(id)photo;
- (BOOL)photoSelectionView:(id)view shouldSelectPhoto:(id)photo;

@end

NS_ASSUME_NONNULL_END
